using System;
using System.Xml.Serialization;
using System.Collections.Generic;
using System.Reflection;

namespace AppliedRecognition.Speech.QuickSwitch.serialization
{

	[Flags]
	public enum ProductSupportLevel
	{
		None = 0,
		Testing = 0x1,
		Basic = 0x2,
		Complete = 0x4,
		All = Testing | Basic | Complete 
	}
	public enum MenuName
	{
		None,
		GlobalMenu,
		TestingMenu,
		TaskMenu,
		ResizeWindowMenu,
		MouseMenu,
		WindowMoveMenu,
	}


	[XmlType("Menu")]
	public class SpeechMenuItem 
	{
		private bool showResultsBox;
		private MenuName name;
		private bool active;
        private List<SpeechCommandItem> commands = new List<SpeechCommandItem>();
        private List<SpeechStringItem> strings = new List<SpeechStringItem>();
		private ProductSupportLevel productLevel;
		
		
		[XmlElement("Strings",typeof(SpeechStringItem))]
		public List<SpeechStringItem> Strings 
		{
			get 
			{ 
				return this.strings; 
			} 
		}

		public bool IsTestingMenu 
		{
			get { return ((ProductLevel & ProductSupportLevel.Testing) != 0)  ; } 
		}
		public bool IsBasicMenu {
			get { return ((ProductLevel & ProductSupportLevel.Basic) != 0)  ; } 
		}
		public bool IsCompleteMenu {
			get { return ((ProductLevel & ProductSupportLevel.Complete) != 0)  ; } 
		}
		
		

				[XmlAttribute()] 
		public ProductSupportLevel ProductLevel {
			get { return this.productLevel; } set { this.productLevel = value;}
		}
		
 
		[XmlAttribute()] 
		public MenuName Name 
		{
			get { return this.name; } set { this.name = value;}
		}

		
		[XmlAttribute()] 
		public bool ShowResultsBox 
		{
			get { return this.showResultsBox; } set { this.showResultsBox = value;}
		}

		
		[XmlAttribute()] 
		public bool Active 
		{
			get { return this.active; } set { this.active = value;}
		}

		
		[XmlElement("Command",typeof(SpeechCommandItem))]
		public List<SpeechCommandItem> Commands 
		{
			get { return this.commands; } 
		}

		public override string ToString() 
		{
			return Name.ToString();
		}
	}

}
